import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '../views/Login/Login.vue'
import Reg from '../views/Reg/Reg.vue'
// 主页
import Home from '../views/Home/Home.vue'
// 主页的儿子
import Welcome from '../views/Home/Welcome.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/Reg',
    component: Reg
  },
  {
    path: '/home',
    component: Home,
    children: [
      {
        path: '',
        component: Welcome
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
